//
//  SIXChatViewController.m
//  weibo
//
//  Created by   李小云 on 16/5/20.
//  Copyright © 2016年 chuhan. All rights reserved.
//

#import "SIXChatViewController.h"
#import "SIXFriendTableController.h"
#import "SIXPopNavgationController.h"
#import "SIXPopViewController.h"

@interface SIXChatViewController ()

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property(nonatomic,strong)SIXPopNavgationController *nav;
@end

@implementation SIXChatViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}

#pragma mark -tableView 数据源和代理方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    return 2;
    
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    cell.backgroundColor = [UIColor grayColor];
    cell.alpha = 0.7;
    
    if (indexPath.row == 0) {
       
        cell.imageView.image = [UIImage imageNamed:@"common_feed_comment"];
        cell.textLabel.text = @"发起聊天";
        cell.textLabel.textColor = [UIColor whiteColor];
    }
 
    if (indexPath.row == 1) {
        
        cell.imageView.image = [UIImage imageNamed:@"health_run_history_icon_time"];
        cell.textLabel.text = @"私密聊天";
        cell.textLabel.textColor = [UIColor whiteColor];
    }
    return cell;
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

        SIXPopViewController *vc = [[SIXPopViewController alloc]init];
        SIXPopNavgationController *nav = [[SIXPopNavgationController alloc]initWithRootViewController:vc];
      [self presentViewController:nav animated:YES completion:^{
        self.view.alpha = 0;
        
        }];
     if (indexPath.row == 0) {
         
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
         [btn setTitle:@"消息" forState:UIControlStateNormal];
         [btn setImage:[UIImage imageNamed:@"health_map_back_icon"] forState:UIControlStateNormal];
         vc.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn];
//         vc.navigationItem.rightBarButtonItem = [UIBarButtonItem alloc]initWithImage:<#(nullable UIImage *)#> style:<#(UIBarButtonItemStyle)#> target:<#(nullable id)#> action:<#(nullable SEL)#>
//        
     }
    if (indexPath.row == 1) {
        vc.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(btClick)];
        vc.navigationItem.title = @"联系人";
    }

    

}

-(void)btClick{
    
    [self dismissViewControllerAnimated:YES completion:nil];
}
@end
